﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LL.Business;
using NanoERP.Model;

namespace NanoERP.Business.BaseInfo
{
    /// <summary>
    /// 单据编号规则配置业务类
    /// </summary>
    public class BilltypeinfoBLL : ServiceBase
    {
        /// <summary>
        /// 单据编号规则配置查询
        /// </summary>
        /// <returns></returns>
        public List<Billtypeinfo> Query()
        {
            var list = this.DbSession.GetAll<Billtypeinfo>().ToList();

            return list;
        }

        /// <summary>
        /// 单据编号规则配置
        /// </summary>
        /// <param name="id">单据编号规则配置ID</param>
        /// <returns></returns>
        public Billtypeinfo Get(long id)
        {
            var o = this.DbSession.Get<Billtypeinfo>(id);
            return o;
        }

        /// <summary>
        /// 编辑单据编号规则配置
        /// </summary>
        /// <param name="o"></param>
        public void Edit(Billtypeinfo o)
        {
            if (o.Id == 0)
                this.DbSession.Insert(o, "Id");
            else
                this.DbSession.Update(o);
        }

        /// <summary>
        /// 删除单据编号规则配置
        /// </summary>
        /// <param name="id"></param>
        public void Delete(long id)
        {
            this.DbSession.Delete<Billtypeinfo>(id);
        }
    }
}
